import { FOLLOW_STATUS } from '@/enum/dynamic';
import { Column, Entity, PrimaryGeneratedColumn } from 'typeorm';
import { BaseEntity } from './base.entity';
import { User } from './user.entity';

/**
 * 用户匹配需求表
 */
@Entity('dynamic_follow')
export class DynamicFollow extends BaseEntity {
  @PrimaryGeneratedColumn({
    type: 'int',
    name: 'id',
    comment: '主键，自增',
  })
  id: number;

  @Column({
    type: 'int',
    name: 'user_id',
    comment: '用户id',
  })
  userId: number;

  @Column({
    type: 'int',
    name: 'target_user_id',
    comment: '目标用户id',
  })
  targetUserId: number;

  @Column({
    type: 'int',
    name: 'status',
    comment: `
      关注状态，
      1表示未关注
      1表示已关注
    `,
  })
  status: FOLLOW_STATUS;

  /**
   * 用户信息
   */
  targetUserInfo?: User;
}
